import "./index.scss";
import { Tabbar } from "@nutui/nutui-react";
import { Home, User } from "@nutui/icons-react";
import HomeIndex from "../home";
import UserIndex from "../user";
import { useState } from "react";

export default function Index() {
  const [activeIndex, setActiveIndex] = useState(0);

  return (
    <div>
      <Tabbar
        fixed
        defaultValue={0}
        value={activeIndex}
        onSwitch={(value) => {
          setActiveIndex(value);
        }}
      >
        <Tabbar.Item title="首页" icon={<Home width={18} height={18} />} />
        <Tabbar.Item title="我的" icon={<User width={18} height={18} />} />
      </Tabbar>
      {activeIndex ? <UserIndex></UserIndex> : <HomeIndex></HomeIndex>}
    </div>
  );
}
